{include file="inc/header.html"}
<?php
    $this->_var['dpagecss'][] = $this->_var['TMPL_REAL']."/css/share-index.css";
    $this->_var['dcpagecss'][] = $this->_var['TMPL_REAL']."/css/share-index.css";
?>
<link rel="stylesheet" type="text/css" href="{function name="parse_css" v="$dpagecss" c="$dcpagecss"}" />
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
	var device;
	var ua = navigator.userAgent.toLowerCase();	
	if (/iphone|ipad|ipod/.test(ua)) {
		device =  "iphone";
	} else if (/android/.test(ua)) {
		device = "android";
	}
</script>
<div class="page page-share page-current" id="page-share-indexs">
	<style>
		body, input, textarea {
		    -webkit-font-smoothing: antialiased;
		    font-family: Arial, DroidSansFallback, Helvetica, Tahoma, \5FAE\8F6F\96C5\9ED1, sans-serif, Sans;
		}
		/*body{max-width:750px;margin:0 auto;}*/
	</style>
	<script type="text/javascript">
	 	if('{$data.wx_url}'){
            location.href = '{$data.wx_url}';
        }
	</script>

	<script type="text/javascript">
		var live_in = Number('{$data.video.live_in}');
		var channel_id = '{$data.video.channelid}';
		var app_id = '{$data.appid}';
        var file_id = '{$data.video.file_id}';
        var urls = '{$data.video.urls}';
        var short_name = '{$data.share.short_name}';
        var video_type = '{$data.video_type}';
        var live_url = '{$data.video.play_hls}';
        var live_url2= '{$data.video.play_flv}';
		// 微信分享
		var wx_title = '{$data.share.share_title}';
		var wx_desc = '{$data.share.share_desc}'; // 分享描述
		var wx_link = '{$data.share.share_wx_url}';
		var wx_img = '{$data.share.share_img_url}'; // 分享图标
			
	    var signature = '{$data.signPackage.signature}';
	    var nonceStr = '{$data.signPackage.nonceStr}';
	    var timestamp = '{$data.signPackage.timestamp}';
	    var url = '{$data.signPackage.url}';
        var appid = '{$data.signPackage.appId}';


		wx.config({
            //debug: true,
			appId:appid,
			timestamp:timestamp,
			nonceStr:nonceStr,
			signature:signature,
			url:url,
			jsApiList:[
				//'checkJsApi',
				'onMenuShareTimeline',
				'onMenuShareAppMessage',
				'onMenuShareQQ',
				'onMenuShareWeibo',
                'onMenuShareQZone',
				'hideMenuItems',
				'showMenuItems',
				'hideAllNonBaseMenuItem',
				'showAllNonBaseMenuItem',
				'translateVoice',
				'startRecord',
				'stopRecord',
				//'onRecordEnd',
				'playVoice',
				'pauseVoice',
				'stopVoice',
				'uploadVoice',
				'downloadVoice',
				'chooseImage',
				'previewImage',
				'uploadImage',
				'downloadImage',
				'getNetworkType',
				'openLocation',
				'getLocation',
				'hideOptionMenu',
				'showOptionMenu',
				'closeWindow',
				'scanQRCode',
				//'chooseWXPay',
				//'openProductSpecificView',
				//'addCard',
				//'chooseCard',
				//'openCard'
			]
		});


	</script>
	<style type="text/css">
		.card-header .card-cover{height: 46.25vw;}
		.f_l{float:left;}
		.f_r{float:right;}
	</style>
	<!-- 下载 -->
	<div class="pop_download intop " id="topDown">
		<a class="pop_download_m down-app" href="{$data.app_down}" external>
			<div class="appdt">
				<div class="logo"><img src="{if $data.app_logo}{$data.app_logo}{else}{$TMPL}/images/app_logo.jpg{/if}" alt="logo"></div>
				<p class="name">{$data.share.short_name}直播</p>
				<p class="oth">{$data.share.share_title}</p>
			</div>
			<div class="btn_down">立即下载</div>	
		</a>	
	</div>
	<!-- 下载 end -->
	<div class="content">
		{if $data.video.live_in == 1 || $data.video.live_in == 3}
		<div class="live_room stat-div" id="liveing">
			<!-- 视频区 -->
			<div class="vedio_wp">
				<div id="id_video_container" style="width:100%;height:320px;"></div>
			</div>
			<!-- 视频区 end -->
			<!-- 互动区 -->
			<div class="live_info" style="display:none; z-index:999;">
				<div class="live_info_hd">
					<div class="player">
						<div class="player_dt">
							<div class="avatar"><img src="{$data.video.head_image}" alt=""></div>
							<div class="info">
								<p class="name">{$data.video.nick_name}</p>
								<p id="play-stat">{$data.video.podcast.user.fans_count}人</p>
							</div>
							<a href="javascript:;" item="592626662" clickid="0.2.2.0" class="btn_focus down-app show_pop_wp">关注</a>	
						</div>
						<div class="player_oth">人气<span class="num">{$data.video.viewer_num}</span></div>
					</div>
				</div>
				<div class="live_info_bd">
					<div class="combofit_box" id="gift-box">
						<!-- 礼物连击浮层 --><!-- .fn_show: 弹出连击窗 -->
						<div id="giftbox1" class="giftbox"></div>
						<div id="giftbox2" class="giftbox"></div>
						<!-- 这里是礼物的信息 -->
					</div>
					<div class="chat_box">
						<div class="chat_list" id="wrapper">
							<ul id="chat-box"></ul>
						</div>
					</div>
					<div class="nav_wp">
						<ul class="nav_list">
							<li>
								<a class="bt show_pop_wp" id="show-chatdiv" href="javascript:;" clickid="0.2.3.0"><i class="ico_chat"></i></a>
							</li>
							<li>
								<a class="bt show_pop_wp" id="share-app" href="javascript:;" clickid="0.2.4.0"><i class="ico_share"></i></a>
							</li>
							<li>
								<a class="bt show_pop_wp" id="send-gift" href="javascript:;" clickid="0.2.5.0"><i class="ico_gift"></i></a>
							</li>
						</ul>
						<!--<div class="btn_openapp down-app"  clickid="0.2.1.0">-->
						<a class="btn_openapp down-app" href="{$data.app_down}">
							<p class="logo"><img src="{if $data.app_logo}{$data.app_logo}{else}{$TMPL}/images/app_logo.jpg{/if}" alt=""></p>
							<p class="tex_hi">立即下载</p>
							<p>观看更流畅</p>
						</a>
						<!--</div>-->
						<!-- 打开APP -->
					</div>
				</div>
			</div>
			<!-- 互动区 end -->
		</div>
		<!-- 暂停 开始页面 -->
		<div class="live_tip stat-div" id="preVedio" style="display:none;">
			<div class="img_lt"><img class="avator_img" src="{$data.video.head_image}" alt=""></div>
			<div class="msg_lt" id="beforePlay" style="">
				<i class="ico_play" id="startplay"></i>
				<p class="des"><span class="clr_main">{$data.video.viewer_num}</span>人观看</p>
			</div>
			<div class="msg_lt" id="loading" style="display:none;">
				<i class="ico_loading"></i>
			</div>
		</div>
		<!-- 暂停 开始页面 end -->
		{elseif $data.video.is_live_pay == 1&&$data.video.live_in = 4}
		<!-- 直播结束 -->
		<div class="live_tip stat-div" id="overLive">
			<div class="img_lt"><img class="avator_img" src="{$data.video.head_image}" alt=""></div>
			<div class="msg_lt">
				<p class="tit">付费直播，请下载APP观看</p>
				<p class="des" id="num">{if $data.video.watch_number gt 0}{$data.video.watch_number}{else}0{/if}人观看</p>
				<a class="lnk_goto" href="#hotlistid">去看看其他热门直播&gt;</a>
			</div>	
		</div>
		<!-- 直播结束 end -->
		{else}
		<!-- 直播结束 -->
		<div class="live_tip stat-div" id="overLive">
			<div class="img_lt"><img class="avator_img" src="{$data.video.head_image}" alt=""></div>
			<div class="msg_lt">
				<p class="tit">直播已结束</p>
				<p class="des" id="num">{if $data.video.watch_number gt 0}{$data.video.watch_number}{else}0{/if}人观看过</p>
				<a class="lnk_goto" href="#hotlistid">去看看其他热门直播&gt;</a>
			</div>	
		</div>
		<!-- 直播结束 end -->
		{/if}
		<!-- 用户信息 -->
		<div class="userinfo">
			<img class="img f_l" src="{$data.video.head_image}">
			<div class="userdetail f_l">
				<h1>{$data.video.nick_name}&nbsp;<i class="icon_sex icon_sex_{$data.video.sex}"></i>&nbsp;<i class="icon_level icon_level_{$data.video.user_level}"></i></h1>
				<h2>{$data.share.short_name}号：{$data.video.user_id}</h2>
			</div>
		</div>
		<!-- 用户信息 end -->
		<!-- 热门直播 -->
		<div class="buttons-tab" id="hotlistid">
			<a href="#hotvideo" class="tab-link active button">热门{$data.share.short_name}</a>
			<a href="#playback" class="tab-link button">ta的精彩回放</a>
		</div>
		<div class="tabs">
		  	<div id="hotvideo" class="tab active">
			    <div class="newrow">
			    	{foreach from=$data.video_hot item=item key=key name=item_name}
			      	<div class="col-50">
			      		<a href="{$item.url}" external>
					      	<div class="card demo-card-header-pic">
						    	<div valign="bottom" class="card-header color-white no-border no-padding">
						      		<img class='card-cover' src="{if $item.live_image neq ''}{$item.live_image}{else}{$item.head_image}{/if}" alt="">
					    		</div>
							    <div class="card-content">
							      	<div class="card-content-inner">
							       	 	<p class="color-gray">{$item.title}</p>
						     	 	</div>
							    </div>
						  	</div>
					  	</a>
			      	</div>
			      	{/foreach}
			    </div>
		  	</div>
		  	<div id="playback" class="tab">
		  		{if $data.history}
			  		<div>
			  			{foreach from=$data.history item=item key=key name=item_name}
						<div class="playback">
							<a href="{$item.url}" external>
								<img class="img f_l" src="{$item.head_image}">
								<div class="userdetail f_l">
									<h1>{$item.nick_name}&nbsp;<span class="">{$item.end_time}</span></h1>
									<h2><span>回放</span></h2>
								</div>
								<div class="fansnum f_r"><i class="icon iconfont">&#xe650;</i>{$item.watch_number}</div>
							</a>
						</div>
						{/foreach}
					</div>
				{else}
					<div>
						<div class="no_history">
							<i class="icon iconfont">&#xe62b;</i>
							<p>Ta还没有精彩回放哦</p>
						</div>
					</div>
				{/if}
		  	</div>
		</div>
		<!-- 热门直播 end -->
	</div>
	<!-- 弹窗提示下载 -->
	<div class="pop_wp" id="opt-down" style="display: none;">
		<div class="pop_box pop_toapp_box ">
			<div class="pop_panel">
				<div class="logo"><img src="{if $data.app_logo}{$data.app_logo}{else}{$TMPL}/images/app_logo.jpg{/if}" alt="logo"></div>
				<p class="name">{$data.share.short_name}直播</p>
				<p class="des">{$data.share.share_title}</p>
				<a href="{$data.app_down}" class="btn_app down-app" clickid="0.4.1.0">下载{$data.share.short_name}直播</a>
			</div>
			<div class="pop_close" id="opt-down-close"></div>
		</div>
	</div>
	<!-- 弹窗提示下载 end -->
</div>
<?php
	$this->_var['dpagejs'][] = $this->_var['TMPL_REAL']."/sdk/json2.js";
	$this->_var['dcpagejs'][] = $this->_var['TMPL_REAL']."/sdk/json2.js";
	$this->_var['dpagejs'][] = $this->_var['TMPL_REAL']."/sdk/webim.js";
	$this->_var['dcpagejs'][] = $this->_var['TMPL_REAL']."/sdk/webim.js";
	$this->_var['dpagejs'][] = $this->_var['TMPL_REAL']."/js/im-message.js";
	$this->_var['dcpagejs'][] = $this->_var['TMPL_REAL']."/js/im-message.js";
	$this->_var['dpagejs'][] = $this->_var['TMPL_REAL']."/js/live-show.js";
	$this->_var['dcpagejs'][] = $this->_var['TMPL_REAL']."/js/live-show.js";
?>
{if $data.video.live_in == 1}
<script src="//qzonestyle.gtimg.cn/open/qcloud/video/live/h5/live_connect.js"></script>
{else}
<script src="//qzonestyle.gtimg.cn/open/qcloud/video/h5/h5connect.js"></script>
{/if}
<script type="text/javascript">
	var device = device || '';

	var head_image_url = '{$data.video.head_image}';
	{if $data.video.group_id}
	var loginInfo = {
		'sdkAppID': '{$data.tim_sdkappid}',
		'appIDAt3rd': '{$data.tim_sdkappid}',
		'accountType': '{$data.tim_account_type}',
		'identifier': '{$data.tim_account_id}',
		'userSig': '{$data.usersig}',
	};
	var avChatRoomId = '{$data.video.group_id}';
	{/if}
</script>
<script type="text/javascript" src="{function name="parse_script" v="$dpagejs" c="$dcpagejs"}"></script>
{include file="inc/footer.html"}